<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>lesson 20</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
  <div id="root"></div>
</body>
<script>

  const app = Vue.createApp({
    template: `
     <myform>
      <strong>提交</strong>
      </myform>
      <myform>
      <button>提交</button>
      </myform>
    `
  });

  app.component('myform', {
    methods: {
      handleClick() {
        alert("点击了提交")
      }
    },
    template: `
      <div>
        <input value="请输入值"></input>
        <span @click="handleClick"> <slot>default value</slot></span>
      </div>
    `
  });

  const vm = app.mount('#root');
</script>

</html>